Field of the Invention
The present invention relates to a communication apparatus, a control method therefor, and a computer-readable storage medium.
Description of the Related Art
A wireless communication standard called Wi-Fi Direct® is known. Wi-Fi Direct is one of wireless communication standards (Wi-Fi) certified by Wi-Fi alliance, which enables a terminal to directly connect to another terminal to transmit/receive data without an access point used in a normal Wi-Fi connection method.
Wi-Fi Direct implements direct connection between electronic devices by defining a protocol for automatically deciding whether each electronic device operates as a wireless LAN access point or wireless LAN station, and eliminating the need for a dedicated device as an access point. As a method of directly connecting terminals by a wireless LAN, there is an “ad hoc mode” in addition to Wi-Fi Direct. The difference between Wi-Fi Direct and the ad hoc mode is as follows. That is, Wi-Fi Direct is a method in which any one of terminals implements the function of a wireless LAN access point (host device), and the ad hoc mode is a connection method which uses no access point.
Japanese Patent Laid-Open No. 2011-124980 discloses an arrangement in which a host device notifies client devices belonging to the same group as that of the host device of frequencies used by other groups and a frequency change timing, changes a frequency used simultaneously with the client devices, and performs connection processing with other groups using the changed frequency.
When causing two or more interfaces to simultaneously (parallelly or concurrently) perform communication operations using one wireless communication unit (wireless chip), assigning different channels for the respective interfaces results in complicated processing. For example, the system configuration of the overall apparatus including hardware and a software arrangement for performing time division processing for communication operations executed in different channels becomes complicated. Therefore, when a communication apparatus including one wireless communication unit parallelly executes communication processes (simultaneous communication), it is desirable to assign a common channel for the respective communication operations.
If one communication apparatus operates in a general infrastructure mode (a mode in which communication is performed via an access point) in a wireless LAN and a P2P mode like Wi-Fi Direct simultaneously using one wireless chip, the following problem arises. For example, when a communication apparatus operates as a client (STA) in the infrastructure mode, an access point side has the right to decide to assign a unique channel to the communication apparatus. On the other hand, when a communication apparatus operates as a group owner (a side of providing an access point function) in the P2P mode, it has the right to decide to assign a channel.
Assume that a communication apparatus performs communication operations in the infrastructure mode and the P2P mode simultaneously. In this case, if the communication apparatus operates as a client in the P2P mode prior to communication in the infrastructure mode, a partner apparatus which operates as an access point in the infrastructure mode or as a group owner may be assigned a channel different from that used in the P2P mode. Therefore, a communication apparatus which cannot parallelly perform communication operations in a plurality of channels cannot simultaneously perform communication operations.
Furthermore, if one communication apparatus operates only in the P2P mode in Wi-Fi Direct with a partner apparatus instead of simultaneously performing communication operations in a plurality of communication modes, one of communication apparatuses needs to become a client and the other needs to become a group owner in a role decision stage before wireless connection.
In either case, that is, if a communication apparatus simultaneously performs operations or if a communication apparatus operates in the P2P mode in Wi-Fi Direct, there is a role decision phase before wireless connection in Wi-Fi Direct. In this phase, a communication apparatus to operate as a group owner is decided based on an Owner Intent. If, however, respective communication apparatuses declare the equal Owner Intents for deciding a group owner, role decision cannot be made, thereby disabling wireless connection.